package com.sky.controller.user;
import com.sky.dto.OrdersSubmitDTO;
import com.sky.result.Result;
import com.sky.service.OrderService;
import com.sky.service.UserOrderService;
import com.sky.vo.OrderSubmitVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 符健清
 * @version 1.0
 */
@SuppressWarnings({"all"})
/**
 * 用户下单明细
 */
@Slf4j
@RestController("userOrder")
@RequestMapping("user/order")
public class OrderDetilController {
    /**
     * 用户下单
     * @param ordersSubmitDTO
     * @return
     */
    @Autowired
    private UserOrderService userOrderService;
    @PostMapping("/submit")
       public Result<OrderSubmitVO> submit(@RequestBody OrdersSubmitDTO ordersSubmitDTO){
        log.info("用户下单 参数 :{}",ordersSubmitDTO);
         OrderSubmitVO orderSubmitVO = userOrderService.sumbit(ordersSubmitDTO);
        return  Result.success(orderSubmitVO);

       }

}
